<template>
	<zui-box>

		<!-- 头部导航 -->
		<zui-navbar title='查看物流'></zui-navbar>
		
		<u-gap height="30rpx"></u-gap>
		<zui-flat bgColor='#fff'> 
			<zui-col height='174rpx'>
				<view class="col_text">快递公司：{{info.ShipperCode}}</view>
				<view class="col_text">快递单号：{{info.LogisticCode}}</view>
			</zui-col>
		</zui-flat>
		<u-gap height="30rpx"></u-gap>
		
		<zui-flat bgColor='#fff'>
			<view class="logistics_box">
				<view class="list">
					<block v-for="(item,index) of list" :key="index">
						<view class="item">
							<view class="text">
								<view class="name">{{item.AcceptStation }}</view>
							</view>
							<view class="time">{{item.AcceptTime}}</view>
						</view>
					</block>
				</view>
			</view>
			<u-gap height="30rpx"></u-gap>
		</zui-flat>

	</zui-box>
</template>

<script>
	export default {
		data() {
			return {
				order_id:'',
				info:'',
				list:[],
			};
		},
		//页面加载完毕
		onLoad(e) {
			console.log(e);
			this.order_id = e.order_id;
		
		},
		onShow() {
			this.get_info();
		},
		methods: {
			
			get_info(){
				// 获取页面订单信息
				uni.$u.http.get('/app/order_product/express', {
					params: {
						order_id:this.order_id,
					},
					custom: {
						auth: true,
						toast: false,
						catch: false,
					},
				}).then(res => {
					this.info=res[0];
					this.list = res[0].Traces;
					console.log('物流信息------------', res);
					
					
				}).catch(err => {
							
				})
			}
		}
	}
</script>

<style lang='scss' scoped>
	.col_text{
		color: #FFE5A5;
		font-size: 28rpx;
	}
	
	.logistics_box{
		box-sizing: border-box;
		display: flex;
		width: 100%;
		flex-direction: column;
		box-sizing: border-box;
		font-size: 28rpx;
	}

	.list{
		padding-left: 64upx;
		color: #9D97A7;
		position: relative;
		.item{
			margin: 24upx 0;
			position: relative;
			padding: 0;
			
			&::before{
				content: '';
				display: flex;
				position: absolute;
				left: -32upx;
				top: 12upx;
				bottom: -36upx;
				width: 4upx;
				align-items: flex-start;
				background-color: #D0D0D0;
			}
				
			&:last-child::before{
				background-color: transparent;
			}
			
			.text{
				position: relative;
				
				&::before{
					display: flex;
					align-items: center;
					content: '';
					position: absolute;
					top: 8upx;
					left: -38upx;
					width: 16upx;
					height: 16upx;
					border-radius: 50%;
					background-color: #CCCCCC;
				}
			}
			.name{
				color: #FFE5A5;
					padding-left: 30rpx;
					box-sizing: border-box;
					font-size: 28rpx;
			}
			.time{
				padding-left: 30rpx;
				box-sizing: border-box;
				font-size: 28rpx;
			}
			&{
				--last-infomation-color: #E63A2A;
			} 
			&:first-child .name{
				color: #E63A2A !important;
			}
			
			&:first-child {
				&::before, 
				.text::before{
					background-color: var(--last-infomation-color);
				}
				.text::before{
					content: '新';
					width: 48upx;
					height: 48upx;
					left: -56upx;
					border-radius: 50%;
					display: flex;
					justify-content: center;
					align-items: center;
					font-size: 10px;
					color: #999;
					background-color: var(--last-infomation-color);
				}
			}
			/* .mwg-logistics-label{
				display: inline-flex;
				padding: 8upx 16upx;
				margin: 8upx;
				background-color: var(--last-infomation-color);
				color: white;
				border-radius: 6upx;
			} */
		}
	}
</style>
